// ==UserScript==
// @name         New Coffee-Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  shows how to use coffeescript compiler
// @author       You
// @require      http://coffeescript.org/extras/coffee-script.js
// @include      http://redmine.ops.holyca.com/redmine/*/*
// ==/UserScript==
/* jshint ignore:start */


//@include限制响应网站
//resetOptionsText1()

function resetOptionsText(){
	devList 	= ["68","67","23","64","65","66","21"]	 
	//测试组人员id
	testerList 	= ["32","29","30","22","31"]
	optionList 	= document.getElementById("issue_assigned_to_id").options

	for (var index=0;index<optionList.length;index++)
	{
		option = optionList[index]
		//select标签不能修改样式
		// if(index%2 ==0)
		// {
		// 	option.style.backgroundColor = 'blue'
		// }else{
		// 	option.style.backgroundColor = 'red'
		// }
		if(setOptionStyle(devList,option,"----Dev----"))	
			continue
		if(setOptionStyle(testerList,option,"----Test----"))	
			continue
	}
}

function setOptionStyle(idList,option,prefix)
{
	for(index in idList)
	{
		userId = idList[index]
		if((userId) == (option.value))
		{
			//alert(idList+" : "+userId+" - "+option.value)
			option.text = prefix + option.text
			return true
		}
	}
	return false
}


resetOptionsText()

